<%@ page language="java"  pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%
String path = request.getContextPath();
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link href="<%=path %>/styles/main.css" rel="stylesheet" type="text/css" />
<link href="<%=path %>/js/jtree/css/tree.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<%=path %>/js/main.js"></script>
<script type="text/javascript" src="<%=path%>/js/jquery-1.4.2.min.js"></script>
<script src="<%=path %>/js/jtree/tree.js" type="text/javascript" ></script>
</head>
<body>
<div id="DetailContent">	
	<div id="tree"></div>	   
	<script type="text/javascript">
		  var treedata=[{ "id": "0", "text": "知识分类", "value": "0", "showcheck": true, "isexpand": false, "checkstate": 0, "hasChildren": true, "ChildNodes": null, "complete": false }];
	      var userAgent = window.navigator.userAgent.toLowerCase();
	      $.browser.msie8 = $.browser.msie && /msie 8\.0/i.test(userAgent);
	      $.browser.msie7 = $.browser.msie && /msie 7\.0/i.test(userAgent);
	      $.browser.msie6 = !$.browser.msie8 && !$.browser.msie7 && $.browser.msie && /msie 6\.0/i.test(userAgent);
	      function load() {        
	          var o = {
	          	showcheck: false,
	          	onnodeclick:function(item){view(item.id);},          
	          	url: "<%=path %>/km/type/list.do",
	          	imagepath:"<%=path %>/js/jtree/images/"          	
	          };
	          o.data = treedata; 
	          $("#tree").treeview(o); 
	      }      
       	 //加载树
      	 if( $.browser.msie6){load();}else{$(document).ready(load);}      
    </script>
</div>  
<!--工具按钮-->
<div  id="FormToobar" style="margin:0 5px; border: solid 1px #6d6d6d;">
	<div id="MsgDiv" style="float:left"></div>
	<div style="float:right">
	    <tt><input name="btnConfirm" type="button" class="But" value="确定" onclick="save()"/> </tt>
	    <tt><input name="btnReturn" type="button" class="But" value="返回" onclick="parent.ymPrompt.close();" /></tt>
    </div>	
</div>
<script type="text/javascript">
	 function save(){
	 	var s=$("#tree").getTCT();     
      	$.post("<%=path %>/km/type/move.do",
      		  {typeId:"<s:property value="typeId"/>",
      		   typePid:s.id
      		  },
      		  function(data){
      		  	parent.refreshTree('move',s.id);
      		  },"string");
      } 
</script>
</body>
</html>
